{% extends 'base.htm' %}
{% set title = 'Photo' %}
{% block body %}
{% if venue_id %}
    {% set backurl = '/venue?vid=' ~ venue_id|urlencode %} 
{% elif user_id %}
    {% set backurl = '/user?userid=' ~ user_id|urlencode %} 
{% else %}
    {% set backurl = '/comments?chkid=' ~ checkin_id|urlencode %}
{% endif %}
<p><a href="{{ backurl }}"><img src="{{ photo.prefix|e ~ '500x500' ~ photo.suffix|e }}"></a></p>

Posted
{% set checkin = photo.checkin %}
{% if checkin %}
    <a href="/comments?chkid={{ checkin.id|urlencode }}">{{ photo.createdAt|fuzzydelta }}</a>
{% else %}
    {{ photo.createdAt|fuzzydelta }}
{% endif %}

{% set user = photo.user %}
{% if user %}
    <br>by {{ name_fmt(user, button=false) }}
{% endif %}

{% set venue = photo.venue %}
{% if venue %}
    <br>at <a href="/venue?vid={{ venue.id|urlencode }}">{{ venue.name|e }}</a>
{% endif %}

{% set source = photo.source %}
{% if source %}
    <br>via <a href="{{ source.url|e }}">{{ source.name|e }}</a>
{% endif %}
{% endblock %}

{# vim:set ft=htmldjango tw=0: #}
